# Recipe file for weechat.
#
# Maintainers: (C) 2016 Mateus P. Rodrigues, mprodrigues@dragora.org.
#
# Under the terms of the GNU General Public License.

program=weechat
version=1.5
release=1

description="
WeeChat is a fast, light and extensible chat client. It runs on many
platforms like Linux, Unix, BSD, GNU Hurd, Mac OS X and Windows
(bash/ubuntu and cygwin).
"

homepage=https://weechat.org/
license=GPLv3

tarname=${program}-${version}.tar.bz2

# Remote source(s)
fetch="https://weechat.org/files/src/$tarname"

# Parallel jobs for the compiler
jobs=1

# Source documentation
docs="ABOUT-NLS AUTHORS* COPYING README*"

build() {
    unpack "${tardir}/$tarname"

    cd "$srcdir"
    ./autogen.sh
    ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS"

    make -j${jobs}
    make -j${jobs} install DESTDIR="$destdir"

    # Copy documentation
    mkdir -p "${destdir}/usr/share/doc/${program}-${version}"
    cp -p $docs "${destdir}/usr/share/doc/${program}-${version}/"
}
